<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/html">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv= "X-UA-Compatible" content = "IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>博艺网-选择档期时间</title>
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='http://m.sui.taobao.org/assets/js/zepto.js' charset='utf-8'></script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/??sm.min.css,sm-extend.min.css">
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/??sm.min.js,sm-extend.min.js' charset='utf-8'></script>
    <script type="text/javascript" src="/common/js/jquery-1.8.2.min.js"></script>
</head>

<body>

<div class="content">
    <div class="list-block">
        <form id="form" method="post">
            <input type="hidden" name="biz_user_id" value="${biz_user_id?string}">
            <input type="hidden" name="user_id" value="${user_id?string}">
        <ul>
            <li>
                <div class="item-content">
                    <div class="item-media"><i class="icon icon-form-gender"></i></div>
                    <div class="item-inner">
                        <div class="item-title label">服务类型</div>
                        <div class="item-input">
                            <select id="product_id" name="product_id">
                            <#if productList??>
                                <#list productList as subFunc>
                                        <option value="${subFunc.getId()?string}" <#if subFunc_index == 0>selected</#if>>${subFunc.getId()?string}-${subFunc.getName()!''} (¥${subFunc.getCurrentPrice()?string("0.00")}元)</option>
                                </#list>
                            </#if>
                            </select>
                        </div>
                    </div>
                </div>
            </li>

            <li>
                <div class="item-content">
                    <div class="item-media"><i class="icon icon-form-calendar"></i></div>
                    <div class="item-inner">
                        <div class="item-title label">下单数量</div>
                        <div class="item-input">
                            <input type="number" name="amount" placeholder="请选择下单数量" value="1">
                        </div>
                    </div>
                </div>
            </li>

            <li>
                <div class="item-content">
                    <div class="item-media"><i class="icon icon-form-calendar"></i></div>
                    <div class="item-inner">
                        <div class="item-title label">执行日期</div>
                        <div class="item-input">
                            <input type="date" name="schedule_date" placeholder="请输入执行日期" value="${current_date}">
                        </div>
                    </div>
                </div>
            </li>
            <li>
                <div class="item-content">
                    <div class="item-media"><i class="icon icon-form-gender"></i></div>
                    <div class="item-inner">
                        <div class="item-title label">宴席时间</div>
                        <div class="item-input">
                            <select id="dinner_type" name="dinner_type">
                                <option value="午宴" selected>午宴</option>
                                <option value="晚宴">晚宴</option>
                            </select>
                        </div>
                    </div>
                </div>
            </li>
        </ul>
    </div>
    <div class="content-block">
        <div class="row">
            <div class="col-50"><button onclick="formSubmit('1');" class="button button-big button-fill button-success">立即购买</button></div>
            <div class="col-50"><button onclick="formSubmit('2')" class="button button-big button-fill button-danger">加入购物车</button></div>
        </div>
    </div>


    </form>
</div>

</body>

<script>
function formSubmit(buy_type){
//    alert(buy_type);
    if (buy_type == "2"){
        document.forms[0].action = "/weixin/addTrolley";
    }else{
        document.forms[0].action = "/weixin/addDirectBuy?pay_status=2";
    }

//    alert(document.forms[0].action);
    document.forms[0].submit();
}
</script>
</html>